package com.sakura.system.dao.glddao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sakura.system.entity.Params;
import com.sakura.system.entity.gld.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
//public interface UserDao extends Mapper<User1> {
public interface UserDao extends BaseMapper<User> {
//     基于注解的方法
    @Select("select * from user")
    List<User> getUser();


    List<User> fibdBySearch(@Param("params") Params params);

    @Select("select * from user where username = #{username} limit 1")
    User findByName(@Param("username") String username);

    @Select("select * from user where username = #{username} and password = #{password} limit 1")
    User findByNameAndPassword(@Param("username") String username, @Param("password") String password);

    @Select("delete from user where id = #{id}")
    void deleteId(@Param("id") String id);

    @Select("select * from user")
    List<User> selectAll();
}
